home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / swingall.jar / javax / swing / plaf / basic / BasicComboPopup$PropertyChangeHandler.class (.txt) < prev    next >
Encoding:
Java Class File  |  1999-07-15  |  1.9 KB  |  44 lines

  1. package javax.swing.plaf.basic;
  2.  
  3. import java.beans.PropertyChangeEvent;
  4. import java.beans.PropertyChangeListener;
  5. import javax.swing.ComboBoxModel;
  6.  
  7. public class BasicComboPopup$PropertyChangeHandler implements PropertyChangeListener {
  8.    // $FF: synthetic field
  9.    private final BasicComboPopup this$0;
  10.  
  11.    protected BasicComboPopup$PropertyChangeHandler(BasicComboPopup var1) {
  12.       this.this$0 = var1;
  13.    }
  14.  
  15.    public void propertyChange(PropertyChangeEvent var1) {
  16.       String var2 = var1.getPropertyName();
  17.       if (var2.equals("model")) {
  18.          this.this$0.uninstallComboBoxModelListeners((ComboBoxModel)var1.getOldValue());
  19.          this.this$0.list.setModel((ComboBoxModel)var1.getNewValue());
  20.          this.this$0.installComboBoxModelListeners((ComboBoxModel)var1.getNewValue());
  21.          if (this.this$0.comboBox.getItemCount() > 0) {
  22.             this.this$0.comboBox.setSelectedIndex(0);
  23.          }
  24.  
  25.          if (this.this$0.isVisible()) {
  26.             this.this$0.hide();
  27.          }
  28.       } else if (var2.equals("renderer")) {
  29.          this.this$0.list.setCellRenderer(this.this$0.comboBox.getRenderer());
  30.          if (this.this$0.isVisible()) {
  31.             this.this$0.hide();
  32.          }
  33.       } else if (var2.equals("JComboBox.lightweightKeyboardNavigation")) {
  34.          Object var3 = var1.getNewValue();
  35.          if (var3.equals("Lightweight")) {
  36.             BasicComboPopup.access$1(this.this$0, true);
  37.          } else if (var3.equals("Heavyweight")) {
  38.             BasicComboPopup.access$1(this.this$0, false);
  39.          }
  40.       }
  41.  
  42.    }
  43. }
  44.